package com.cross.filter;

import com.cross.core.AbstractReader;
import com.cross.core.Reader;
import com.cross.core.Row;

public abstract class AbstractReaderFilter extends AbstractReader implements Filter {

	private Reader<Row> reader;
	
	public AbstractReaderFilter(Reader<Row> reader){
		this.reader = reader;
	}
	@Override
	protected boolean nextRow() {
		try {
			currentRow = filte(reader.next());
			return true;
		} catch (Exception e) {
			e.printStackTrace();
			return false;
		}
	}

	@Override
	public void close() {
		reader.close();
	}

}
